package com.example.demo.design.chain_responsibility;

/**
 * @Author: liull
 * @Description: 抽象处理者
 * @Date: Created in 16:26 2020/12/24
 * @Modified By:
 */
public abstract class Handler {

    /**
     * 抽象处理者中定义了一个抽象处理者类型的对象,作为对其下家的引用，通过该引用，处理者可以形成一条链
     */
    protected Handler successor;

    public abstract void handleRequest(String request);

    public Handler getSuccessor() {
        return successor;
    }

    public void setSuccessor(Handler successor) {
        this.successor = successor;
    }
}
